package models;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.Lob;
import javax.persistence.ManyToMany;

import siena.Table;
import siena.core.Aggregated;
import siena.core.Many;

@Table("lesson_plans")
public class LessonPlan extends TaggableModel {

	public String objective;
	
	public String body;
	
	@Aggregated
	public Many<Material> materials;
	
	@Aggregated
	public Many<Skill> skills;
	
	public LessonPlan(String title) {
		super(title);
	}

	public void tag(String tag) {
		tags.add(Tag.findOrCreateByName(tag));
	}
	
	public String toString() {
		return title;
	}
}
